const path = require('path');

// path的常用API：
// 解析路径：path.parse
console.log(__filename);
console.log(__dirname);
console.log('path.parse:', path.parse(__filename));

// 获取路径名：path.basename
console.log('path.basename:', path.basename(__filename));
console.log('path.basename:', path.basename(__dirname));

// 获取路径的后缀名：path.dirname
console.log('path.dirname:', path.dirname(__dirname));

// 文件路径：path.extname
console.log('path.extname:', path.extname(__filename));

// 路径拼接 path.join
console.log(path.join(__dirname, '525.js'))
 